package model;

public class Sedan extends Car{
    private int seats;
    private String carLevel;//级别(A级，B级，C级)


    public Sedan() {
    }

    public Sedan(String id, String brand, double priceDay, boolean isElectric, boolean isRented, int seats, String carLevel) {
        super(id, brand, priceDay, isElectric, isRented);
        this.seats = seats;
        this.carLevel = carLevel;
    }

    /**
     * 获取
     * @return seats
     */
    public int getSeats() {
        return seats;
    }

    /**
     * 设置
     * @param seats
     */
    public void setSeats(int seats) {
        this.seats = seats;
    }

    /**
     * 获取
     * @return carLevel
     */
    public String getCarLevel() {
        return carLevel;
    }

    /**
     * 设置
     * @param carLevel
     */
    public void setCarLevel(String carLevel) {
        this.carLevel = carLevel;
    }

    public String toString() {
        return "Sedan{seats = " + seats + ", carLevel = " + carLevel + "}";
    }

    @Override
    public double TotalPrice(int day) {
        if (day > 7) {//长期租赁可打9折
            return priceDay * day * 0.9;
        } else {
            return priceDay * day;
        }
    }
}
